{% extends 'TopxiaAdminBundle::layout.html.twig' %}

{% set menu = 'admin_classroom_manage' %}

{% set script_controller='classroombundle/controller/classroom-admin/classroom' %}
{% block main %}

{% if setting("classroom.enabled") %}

  <form id="message-search-form" class="form-inline well well-sm" action="" method="get" novalidate>

    <div class="form-group">
      <input class="form-control" type="text" placeholder="班级名称" name="title" value="{{ app.request.get('title') }}">
    </div>

    <button class="btn btn-primary">搜索</button>

  </form>
  {% if classroomInfo%}
  <table class="table table-striped table-hover" id="classroom-table">
    <thead>
    <tr>
      <th width="40%">班级名称</th>
      <th>课程数</th>
      <th>学员数</th>
      <th>价格</th>
      <th>状态</th>
      <th>操作</th>
    </tr>
    </thead>
    <tbody>

   {% for classroom in classroomInfo %}
      {% set category = categories[classroom.categoryId]|default(null) %}
      {% include 'ClassroomBundle:ClassroomAdmin:table-tr.html.twig' with {classroom:classroom,category:category} %}

   {% endfor %}

    </tbody>

  </table>
  {% else %}
    <div class="empty">暂无班级信息!</div>
  {% endif %}
  <div class="pull-right">
 {{ web_macro.paginator(paginator) }}
</div>

{% else %}
<div class="well">


班级功能未开启，请先在<a href="{{ path('admin_classroom_setting') }}"> 系统-课程设置-班级 </a>中设置开启

</div>
{% endif %}

{% endblock %}